proxy: fix indentation warning
authorVladimír Chlup <[email protected]>
Thu, 27 Feb 2025 20:42:02 +0000 (21:42 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Sun, 19 Oct 2025 18:07:22 +0000 (20:07 +0200)
Fixes the following warning caused by a bad indentation:

src/proxy.c: In function ‘proxy_set’:
src/proxy.c:161:17: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
  161 |                 for (i = 0; i < downlinks_cnt && downlinks[i] == iface->iface->ifindex; ++i);
      |                 ^~~
src/proxy.c:162:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
  162 |                         if (i == downlinks_cnt)
      |                         ^~

Signed-off-by: Vladimír Chlup <[email protected]>
Link: https://github.com/openwrt/omcproxy/pull/13
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/proxy.c

index 8114763b01b118e4271844aa4a04f4a5f38ccbde..80e7b58ec6defc466ee89b7b0b9a14e16cbc9edd 100644 (file)
@@ -159,8 +159,8 @@ int proxy_set(int uplink, const int downlinks[], size_t downlinks_cnt, enum prox
 
                size_t i;
                for (i = 0; i < downlinks_cnt && downlinks[i] == iface->iface->ifindex; ++i);
-                       if (i == downlinks_cnt)
-                               proxy_remove_downlink(container_of(iface, struct proxy_downlink, iface));
+               if (i == downlinks_cnt)
+                       proxy_remove_downlink(container_of(iface, struct proxy_downlink, iface));
        }
 
        for (size_t i = 0; i < downlinks_cnt; ++i) {